﻿using System.Collections.Generic;
using NUnit.Framework;

namespace Dgg.LearnYourTools.NUnit.C_Assertions.e_ChangeBehavior
{
	[TestFixture]
	public class _028_AlternativeComparisons
	{
		[Test]
		public void AlternativeComparison()
		{
			Assert.That(new[] { 5, 4, 3, 2, 1 }, Is.Not.Ordered);

			Assert.That(new[] { 5, 4, 3, 2, 1 }, Is.Ordered.Using(new ReverseOrdering()));
		}

		class ReverseOrdering : IComparer<int>
		{
			public int Compare(int x, int y)
			{
				return -1 * x.CompareTo(y);
			}
		}
	}
}
